package com.ruoyi.project.hissystem.domain;

import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author : 杨磊
 * @date : 14:56 2021/8/19
 */
public class HisRole extends BaseEntity {

     private static final long serialVersionUID = 1L;

    /** 角色ID */
    @Excel(name = "角色序号", cellType = Excel.ColumnType.NUMERIC)
    private Long roleId;

    /** 角色名称 */
    @Excel(name = "角色名称")
    private String roleName;

    /** 角色权限 */
    @Excel(name = "角色权限")
    private String roleKey;

    /** 角色排序 */
    @Excel(name = "角色排序")
    private String roleSort;

    /** 数据范围（1：所有数据权限；2：自定义数据权限；3：本部门数据权限；4：本部门及以下数据权限） */
    @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
    private String dataScope;

    /** 菜单树选择项是否关联显示（ 0：父子不互相关联显示 1：父子互相关联显示） */
    private boolean menuCheckStrictly;

    /** 部门树选择项是否关联显示（0：父子不互相关联显示 1：父子互相关联显示 ） */
    private boolean deptCheckStrictly;

    /** 角色状态（0正常 1停用） */
    @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 用户是否存在此角色标识 默认不存在 */
    private boolean flag = false;

    /** 菜单组 */
    private Long[] menuIds;

    /** 部门组（数据权限） */
    private Long[] departIds;

    @Override
    public String toString() {
        return "HisRole{" +
              "roleId=" + roleId +
              ", roleName='" + roleName + '\'' +
              ", roleKey='" + roleKey + '\'' +
              ", roleSort='" + roleSort + '\'' +
              ", dataScope='" + dataScope + '\'' +
              ", menuCheckStrictly=" + menuCheckStrictly +
              ", deptCheckStrictly=" + deptCheckStrictly +
              ", status='" + status + '\'' +
              ", delFlag='" + delFlag + '\'' +
              ", flag=" + flag +
              ", menuIds=" + Arrays.toString(menuIds) +
              ", departIds=" + Arrays.toString(departIds) +
              '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        HisRole hisRole = (HisRole) o;
        return menuCheckStrictly == hisRole.menuCheckStrictly && deptCheckStrictly == hisRole.deptCheckStrictly && flag == hisRole.flag && Objects.equals(roleId, hisRole.roleId) && Objects.equals(roleName, hisRole.roleName) && Objects.equals(roleKey, hisRole.roleKey) && Objects.equals(roleSort, hisRole.roleSort) && Objects.equals(dataScope, hisRole.dataScope) && Objects.equals(status, hisRole.status) && Objects.equals(delFlag, hisRole.delFlag) && Arrays.equals(menuIds, hisRole.menuIds) && Arrays.equals(departIds, hisRole.departIds);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(roleId, roleName, roleKey, roleSort, dataScope, menuCheckStrictly, deptCheckStrictly, status, delFlag, flag);
        result = 31 * result + Arrays.hashCode(menuIds);
        result = 31 * result + Arrays.hashCode(departIds);
        return result;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleKey() {
        return roleKey;
    }

    public void setRoleKey(String roleKey) {
        this.roleKey = roleKey;
    }

    public String getRoleSort() {
        return roleSort;
    }

    public void setRoleSort(String roleSort) {
        this.roleSort = roleSort;
    }

    public String getDataScope() {
        return dataScope;
    }

    public void setDataScope(String dataScope) {
        this.dataScope = dataScope;
    }

    public boolean isMenuCheckStrictly() {
        return menuCheckStrictly;
    }

    public void setMenuCheckStrictly(boolean menuCheckStrictly) {
        this.menuCheckStrictly = menuCheckStrictly;
    }

    public boolean isDeptCheckStrictly() {
        return deptCheckStrictly;
    }

    public void setDeptCheckStrictly(boolean deptCheckStrictly) {
        this.deptCheckStrictly = deptCheckStrictly;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Long[] getMenuIds() {
        return menuIds;
    }

    public void setMenuIds(Long[] menuIds) {
        this.menuIds = menuIds;
    }

    public Long[] getDepartIds() {
        return departIds;
    }

    public void setDepartIds(Long[] departIds) {
        this.departIds = departIds;
    }

    public HisRole(Long roleId, String roleName, String roleKey, String roleSort, String dataScope, boolean menuCheckStrictly, boolean deptCheckStrictly, String status, String delFlag, boolean flag, Long[] menuIds, Long[] departIds) {
        this.roleId = roleId;
        this.roleName = roleName;
        this.roleKey = roleKey;
        this.roleSort = roleSort;
        this.dataScope = dataScope;
        this.menuCheckStrictly = menuCheckStrictly;
        this.deptCheckStrictly = deptCheckStrictly;
        this.status = status;
        this.delFlag = delFlag;
        this.flag = flag;
        this.menuIds = menuIds;
        this.departIds = departIds;
    }

    public HisRole() {
    }
}
